package com.hp_dzzl.mixin.Capsule;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;

import capsule.structure.CapsuleTemplate;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
import net.minecraft.network.chat.Component;
import net.minecraft.world.level.block.Block;

import java.util.List;
import java.util.Map;

@Mixin(targets = "capsule.StructureSaver", remap = false)
public class StructureSaverMixin {
    /**
     * @author 你的名字
     * @reason 强制跳过所有放置检测，直接允许放置建筑
     */
    @Overwrite
    public static void checkDestination(CapsuleTemplate template, StructurePlaceSettings placementIn, ServerLevel destWorld, BlockPos destOriginPos, int size,
                                        Map<BlockPos, Block> outOccupiedPositions, List<Component> outErrors) {
        // 直接空实现！删除所有原有检测逻辑
        // outErrors保持空列表 = 没有错误，允许放置
        // outOccupiedPositions不需要处理，强制覆盖所有位置
    }
}